package cn.jingyuan.swan.uaa.web.controller;

import cn.jingyuan.swan.cloud.core.Result;
import cn.jingyuan.swan.cloud.core.ResultUtils;
import cn.jingyuan.swan.uaa.constants.UaaServerConstants;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Controller
public class IndexController {

    @ResponseBody
    @GetMapping(path = "/")
    public Result<?> index() {
        Map<String, Object> map = new HashMap<>();
        map.put("application", UaaServerConstants.SERVICE_NAME);
        map.put("amt", 2.51D);
        map.put("size", 3.93F);
        map.put("pig", BigDecimal.valueOf(2.3D));

        return ResultUtils.ok(map);
    }

}
